package cn.py.boot_lua.pattern.iterator;

// 客户端代码
public class Client {
    public static void main(String[] args) {
        Aggregate aggregate = new Aggregate();
        aggregate.add("Item 1");
        aggregate.add("Item 2");

        Iterator iterator = aggregate.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
